package com.ddx.common.enums;

/**
 * @author dudianbo
 * @ClassName: ${CLASSNAME}
 * @Description: 数字货币类型
 * @date 2018/4/19
 */
public enum  CurrencyType {
    BTC(0,"BTC", "比特币"),
    ETH(1,"ETH","以太坊"),
    CFB(2,"CFB","CFB");
    private Integer code;
    private String type;
    private String msg;

    CurrencyType(Integer code,String type, String msg) {
        this.code=code;
        this.msg=msg;
        this.type=type;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    public static CurrencyType getCurrencyType(Integer code) {
        for (CurrencyType t : CurrencyType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
